include(FeatureSummary)
set_package_properties(libOPNMIDI PROPERTIES
    URL "https://github.com/Wohlstand/libOPNMIDI"
    DESCRIPTION "A Software MIDI Synthesizer library with OPN2 (YM2612) emulator"
)

@PACKAGE_INIT@

if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/libOPNMIDI-shared-targets.cmake")
    include("${CMAKE_CURRENT_LIST_DIR}/libOPNMIDI-shared-targets.cmake")
endif()
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/libOPNMIDI-static-targets.cmake")
    include("${CMAKE_CURRENT_LIST_DIR}/libOPNMIDI-static-targets.cmake")
endif()

if(TARGET libOPNMIDI::OPNMIDI_shared)
    if(CMAKE_VERSION VERSION_LESS "3.18")
        add_library(libOPNMIDI::OPNMIDI_IF INTERFACE IMPORTED)
        set_target_properties(libOPNMIDI::OPNMIDI_IF PROPERTIES INTERFACE_LINK_LIBRARIES "libOPNMIDI::OPNMIDI_shared")
    else()
        add_library(libOPNMIDI::OPNMIDI_IF ALIAS libOPNMIDI::OPNMIDI_shared)
    endif()
else()
    if(CMAKE_VERSION VERSION_LESS "3.18")
        add_library(libOPNMIDI::OPNMIDI_IF INTERFACE IMPORTED)
        set_target_properties(libOPNMIDI::OPNMIDI_IF PROPERTIES INTERFACE_LINK_LIBRARIES "libOPNMIDI::OPNMIDI_static")
        add_library(libOPNMIDI::OPNMIDI_IF_STATIC INTERFACE IMPORTED)
        set_target_properties(libOPNMIDI::OPNMIDI_IF_STATIC PROPERTIES INTERFACE_LINK_LIBRARIES "libOPNMIDI::OPNMIDI_static")
    else()
        add_library(libOPNMIDI::OPNMIDI_IF ALIAS libOPNMIDI::OPNMIDI_static)
        add_library(libOPNMIDI::OPNMIDI_IF_STATIC ALIAS libOPNMIDI::OPNMIDI_static)
    endif()
endif()
